#ifndef XP_H_
#define XP_H_

#include <stdio.h>
#include <stdlib.h>

/**
 * int callback(int keycode, bool pressed)
 */
typedef int (*XP_KEY_CALLBACK)(int, bool);
typedef int (*XP_MOUSE_CALLBACK)(int, int, int);
typedef int (*XP_RESIZE_CALLBACK)(int, int);

#define XP_SHUTDOWN 1
#define XP_NO_OP 0

#ifdef MINIMAL
	#define PRINT_ERROR(x) ;
	#define PRINT(x) ;
#else
	#define PRINT_ERROR(x) fprintf(stderr, x)
	#define PRINT(x) printf(x);
#endif

bool xp_open(char* title, int width, int height, bool fullscreen);
bool xp_open_fullscreen(char* title, int width, int height);
bool xp_open_windowed(char* title, int width, int height);

void xp_register_keyboard_callback(XP_KEY_CALLBACK callback);
void xp_register_mouse_callback(XP_MOUSE_CALLBACK callback);
void xp_register_resize_callback(XP_RESIZE_CALLBACK callback);
int xp_handle_events();

int xp_close();


#endif /* XP_H_ */
